<template>
  <view class="container">
    <uni-list>
      <uni-list-item
        showExtraIcon="true"
        v-for="item in infos"
        :key="item.name"
        :extraIcon="{ type: item.icon }"
        :title="item.label"
        :rightText="user[item.name]" />
    </uni-list>
  </view>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters(['userInfo']),
  },
  data() {
    return {
      user: {},
      roleGroup: '',
      postGroup: '',
      infos: [
        {
          name: 'username',
          label: '用户昵称',
          icon: 'person-filled',
        },
        {
          name: 'phone',
          label: '手机号码',
          icon: 'phone-filled',
        },
        {
          name: 'email',
          label: '邮箱',
          icon: 'email-filled',
        },
        {
          name: 'sexName',
          label: '性别',
          icon: 'heart-filled',
        },
        {
          name: 'roleName',
          label: '角色',
          icon: 'staff-filled',
        },
        {
          name: 'wechat',
          label: '微信',
          icon: 'weixin',
        },
        {
          name: 'qq',
          label: 'QQ',
          icon: 'qq',
        },
        {
          name: 'address',
          label: '地址',
          icon: 'map-pin-ellipse',
        },
        {
          name: 'createTime',
          label: '创建时间',
          icon: 'calendar-filled',
        },
      ],
    }
  },
  onReady() {
    this.user = this.userInfo
  },
  methods: {},
}
</script>

<style lang="scss">
page {
  background-color: #ffffff;
}
</style>
